saga2edit manual: Commands

Commands

Commands are the payload of triggers and NPCs. It is also possible to execute command via script.

Script Commands

A command can execute a script from script bank 1 or 2. Saga2edit uses unified indexing for these two banks, so the script number goes from 0 to 511 (although, by default, script bank 1 doesn't use all its indices.) By convention, script 0 does nothing and is used for NPCs that do nothing.

Shop Commands

A shop command will open the corresponding shop. 255 is a special shop value that open the inn instead.

Door Commands

A door command will teleport the player (usually to a new map) according to the indicated door. There are two (or three depending on how you count) banks of door data, but saga2edit uses unified indexing for these, so you can simply indicate a door between 0 and 543 except for 511. Door 511 is a special value reserved to indicate an exit door (which saga2edit treats as a different command type).

Exit Door Commands

An exit door will return the player to their position before the last door they entered. Whenever possible (generally, for areas with only one way in or out), exit doors should be used to preserve door indices.

Note that there is only one exit door slot; there is not a stack.

Sound Commands

Sound commands can play a sound or change the music. Values starting at 128 will play sounds. Values starting at 64 will play foreground music. This music will replace the current music until it finishes (if it finishes), but the game won't remember it. Values starting at 0 will change the background music.

To determine which audio is associated with which number, it may be helpful to use the in-game sound test feature. To access this feature, press B on the title screen while holding start and select.

Item Commands

This command has special behavior when used with NPCs. NPCs with the item commands are assumed by the game to be chest NPCs. This command will handle all normal chest logic including checking the chest flag, changing the chest facing (so it appears open), and changing the chest flag.

Otherwise, this command will grant the item with the accompanying "received" message. If the inventory is full, the "can't carry" message is displayed instead.

Magi Commands

The magi command, like the item command, will treat NPCs like chests. Otherwise, it will simply grant the indicated magi with the accompanying message.

Item Force Commands

Item force is like the item command, but it has no special chest handling. Additionally, if the player's inventory is full, it will bring up a prompt for the player to drop an item to replace with the new item.

Battle Door Commands

Battle door command are a special way of activating normal doors. A battle door will appear to work the same as the corresponding normal door, but the return position is saved in a special battle door slot instead of the normal exit door slot. (The vanilla game uses this to teleport the player for the Odin cutscene. It may be hard to use the functionality profitably without using it in the same context or doing some assembly coding.)

The game can't encode battle doors 512 or beyond.